package ca.ericslandry.server.guice;

import net.customware.gwt.dispatch.server.guice.ActionHandlerModule;

import org.apache.commons.logging.Log;

import ca.ericslandry.server.handler.GetIssueHandler;
import ca.ericslandry.server.handler.GetIssuesByProximityHandler;
import ca.ericslandry.server.handler.GetIssuesHandler;
import ca.ericslandry.server.handler.GetUserHandler;
import ca.ericslandry.server.handler.LoginHandler;
import ca.ericslandry.server.handler.SaveIssueHandler;
import ca.ericslandry.server.handler.SaveUserHandler;

import com.google.inject.Singleton;

/**
 * Module which binds the handlers and configurations
 */
public class ServerModule extends ActionHandlerModule {
	@Override
	protected void configureHandlers() {
		bindHandler(GetIssueHandler.class);
		bindHandler(GetIssuesHandler.class);
		bindHandler(GetIssuesByProximityHandler.class);
		bindHandler(GetUserHandler.class);
		bindHandler(LoginHandler.class);
		bindHandler(SaveIssueHandler.class);
		bindHandler(SaveUserHandler.class);
		bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
	}
}